package com.queclink.ycm.entity.data.useless;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import com.queclink.ycm.common.utils.HexUtils;
import com.queclink.ycm.entity.data.Data;

/**
 * @author jim.li
 * @email jim.li@queclink.com
 * @date 2021-12-24 19:10:00
 */
public class Data59 extends Data {

    private String VehicleModel;

    public Data59() {
    }

    @JSONField(
            name = "VehicleModel"
    )
    public String getVehicleModel(JSONObject jsonObject) {
        StringBuffer sb = new StringBuffer();
        Integer satelliteCount = jsonObject.getInteger("VehicleModel");
        String s = HexUtils.intToHex(satelliteCount, 4);
        sb.append(s);
        return sb.toString();
    }

    public void setVehicleModel(String vehicleModel) {
        this.VehicleModel = vehicleModel;
    }

    public String getDataID() {
        // data59
        return "3b";
    }

    public String getLength() {
        return "02";
    }

    @Override
    public String combine(JSONObject jsonObject) throws Exception {
        StringBuffer sb = new StringBuffer();
        sb.append(this.getDataID());
        sb.append(this.getLength());
        sb.append(this.getVehicleModel(jsonObject));
        return sb.toString();
    }

}
